Carbon


ScrollRect

Header: Quickdraw.h Carbon status: Supported

Scroll the pixels of a specified portion of a basic graphics port’s bitmap (or a color graphics port’s pixel map).

void ScrollRect (
    const Rect *r, 
    SInt16 dh, 
    SInt16 dv, 
     updateRgn
);
Parameter descriptions
r

The pointer to the rectangle defining the area to be scrolled.

dh

The horizontal distance to be scrolled.

dv

The vertical distance to be scrolled.

updateRgn

A handle to the region of the window that needs to be updated.

DISCUSSION

The ScrollRect function shifts pixels that are inside the specified rectangle of the current graphics port. No other pixels or the bits they represent are affected. The pixels are shifted a distance of dh horizontally and dv vertically. The positive directions are to the right and down. The pixels that are shifted out of the specified rectangle are not displayed, and the bits they represent are not saved. It is up to your application to save this data.

The empty area created by the scrolling is filled with the graphics port’s background pattern, and the update region is changed to this filled area.

The ScrollRect function doesn’t change the local coordinate system of the graphics port; it simply moves the rectangle specified in the r parameter to different coordinates. Notice that ScrollRect doesn’t move the graphics pen or the clipping region. However, because the document has moved, they’re in different positions relative to the document.

By creating an update region for the window, ScrollRect forces an update event. After using ScrollRect, your application should use its own window-updating code to draw into the update region of the window.

The ScrollRect function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)